<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 3//EN">
<HTML><HEAD>
		<TITLE>User's Reference - Shade</TITLE>
		<META HTTP-EQUIV="keywords" CONTENT="GRAPHICS VISUALIZATION VISUAL PROGRAM DATA
MINING">
	<meta http-equiv="content-type" content="text/html;charset=ISO-8859-1">
</HEAD><BODY BGCOLOR="#FFFFFF" link="#00004b" vlink="#4b004b">
		<TABLE width=510 border=0 cellpadding=0 cellspacing=0>
			<TR>
				<TD><IMG src="../images/spacer.gif" width=80 height=1></TD>
				<TD><IMG src="../images/spacer.gif" width=49 height=1></TD>
				<TD><IMG src="../images/spacer.gif" width=24 height=1></TD>
				<TD><IMG src="../images/spacer.gif" width=100 height=1></TD>
				<TD><IMG src="../images/spacer.gif" width=3 height=1></TD>
				<TD><IMG src="../images/spacer.gif" width=127 height=1></TD>
				<TD><IMG src="../images/spacer.gif" width=6 height=1></TD>
				<TD><IMG src="../images/spacer.gif" width=50 height=1></TD>
				<TD><IMG src="../images/spacer.gif" width=71 height=1></TD>
			</TR>
			<TR>
				<TD colspan=9><IMG src="../images/flcgh_01.gif" width=510 height=24 alt="OpenDX - Documentation"></TD>
			</TR>
			<TR>
				<TD colspan=2><A href="../allguide.htm"><IMG src="../images/flcgh_02.gif" width=129 height=25 border="0" alt="Full Contents"></A></TD>
				<TD colspan=3><A href="../qikguide.htm"><IMG src="../images/flcgh_03.gif" width=127 height=25 border="0" alt="QuickStart Guide"></A></TD>
				<TD><A href="../usrguide.htm"><IMG src="../images/flcgh_04.gif" width=127 height=25 border="0" alt="User's Guide"></A></TD>
				<TD colspan=3><B><A href="../refguide.htm"><IMG src="../images/flcgh_05d.gif" width=127 height=25 border="0" alt="User's Reference"></A></B></TD>
			</TR>
			<TR>
				<TD><A href="refgu136.htm"><IMG src="../images/flcgh_06.gif" width=80 height=17 border="0" alt="Previous Page"></A></TD>
				<TD colspan=2><A href="refgu138.htm"><IMG src="../images/flcgh_07.gif" width=73 height=17 border="0" alt="Next Page"></A></TD>
				<TD><A href="../refguide.htm"><IMG src="../images/flcgh_08.gif" width=100 height=17 border="0" alt="Table of Contents"></A></TD>
				<TD colspan=3><A href="refgu009.htm"><IMG src="../images/flcgh_09.gif" width=136 height=17 border="0" alt="Partial Table of Contents"></A></TD>
				<TD><A href="refgu175.htm"><IMG src="../images/flcgh_10.gif" width=50 height=17 border="0" alt="Index"></A></TD>
				<TD><A href="../srchindx.htm"><IMG src="../images/flcgh_11.gif" width=71 height=17 border="0" alt="Search"></A></TD>
			</TR>
		</TABLE>
		<H3><A name="HDRSHADE" ></A>Shade</H3>
		<A NAME="IDX701"></A><A NAME="IDX702"></A>
<P><STRONG>Category</STRONG>
<P>
<A HREF="refgu008.htm#HDRCATREN">Rendering</A>
<A NAME="IDX703"></A>
<P><STRONG>Function</STRONG>
<P>
Specifies the shading attributes of an object.
<P><STRONG>Syntax</STRONG>
<PRE><STRONG>
output</STRONG> = Shade(<STRONG>input, shade, how, specular, shininess, diffuse,
               ambient</STRONG>);
</PRE>
<P><STRONG>Inputs</STRONG>
<BR>
<TABLE BORDER>
<TR>
<TH ALIGN="LEFT" VALIGN="TOP" WIDTH="20%">Name
</TH><TH ALIGN="LEFT" VALIGN="TOP" WIDTH="20%">Type
</TH><TH ALIGN="LEFT" VALIGN="TOP" WIDTH="20%">Default
</TH><TH ALIGN="LEFT" VALIGN="TOP" WIDTH="40%">Description
</TH></TR><TR>
<TD ALIGN="LEFT" VALIGN="TOP" WIDTH="20%"><TT><STRONG>input</STRONG></TT>
</TD><TD ALIGN="LEFT" VALIGN="TOP" WIDTH="20%">object
</TD><TD ALIGN="LEFT" VALIGN="TOP" WIDTH="20%">none
</TD><TD ALIGN="LEFT" VALIGN="TOP" WIDTH="40%">object to be shaded
</TD></TR><TR>
<TD ALIGN="LEFT" VALIGN="TOP" WIDTH="20%"><TT><STRONG>shade</STRONG></TT>
</TD><TD ALIGN="LEFT" VALIGN="TOP" WIDTH="20%">flag
</TD><TD ALIGN="LEFT" VALIGN="TOP" WIDTH="20%">1
</TD><TD ALIGN="LEFT" VALIGN="TOP" WIDTH="40%">0: object not shaded
<BR>
1: object shaded
</TD></TR><TR>
<TD ALIGN="LEFT" VALIGN="TOP" WIDTH="20%"><TT><STRONG>how</STRONG></TT>
</TD><TD ALIGN="LEFT" VALIGN="TOP" WIDTH="20%">string
</TD><TD ALIGN="LEFT" VALIGN="TOP" WIDTH="20%">none
</TD><TD ALIGN="LEFT" VALIGN="TOP" WIDTH="40%">("smooth" or "faceted")
</TD></TR><TR>
<TD ALIGN="LEFT" VALIGN="TOP" WIDTH="20%"><TT><STRONG>specular</STRONG></TT>
</TD><TD ALIGN="LEFT" VALIGN="TOP" WIDTH="20%">scalar
</TD><TD ALIGN="LEFT" VALIGN="TOP" WIDTH="20%">none
</TD><TD ALIGN="LEFT" VALIGN="TOP" WIDTH="40%">specular coefficient
<BR>
(standard = 0.5)
</TD></TR><TR>
<TD ALIGN="LEFT" VALIGN="TOP" WIDTH="20%"><TT><STRONG>shininess</STRONG></TT>
</TD><TD ALIGN="LEFT" VALIGN="TOP" WIDTH="20%">integer
</TD><TD ALIGN="LEFT" VALIGN="TOP" WIDTH="20%">none
</TD><TD ALIGN="LEFT" VALIGN="TOP" WIDTH="40%">shininess exponent
<BR>
(standard = 10)
</TD></TR><TR>
<TD ALIGN="LEFT" VALIGN="TOP" WIDTH="20%"><TT><STRONG>diffuse</STRONG></TT>
</TD><TD ALIGN="LEFT" VALIGN="TOP" WIDTH="20%">scalar
</TD><TD ALIGN="LEFT" VALIGN="TOP" WIDTH="20%">none
</TD><TD ALIGN="LEFT" VALIGN="TOP" WIDTH="40%">diffuse coefficient
<BR>
(standard = 0.7)
</TD></TR><TR>
<TD ALIGN="LEFT" VALIGN="TOP" WIDTH="20%"><TT><STRONG>ambient</STRONG></TT>
</TD><TD ALIGN="LEFT" VALIGN="TOP" WIDTH="20%">scalar
</TD><TD ALIGN="LEFT" VALIGN="TOP" WIDTH="20%">none
</TD><TD ALIGN="LEFT" VALIGN="TOP" WIDTH="40%">ambient coefficient
<BR>
(standard = 1.0)
</TD></TR></TABLE>
<P><STRONG>Outputs</STRONG>
<BR>
<TABLE BORDER>
<TR>
<TH ALIGN="LEFT" VALIGN="TOP" WIDTH="25%">Name
</TH><TH ALIGN="LEFT" VALIGN="TOP" WIDTH="25%">Type
</TH><TH ALIGN="LEFT" VALIGN="TOP" WIDTH="50%">Description
</TH></TR><TR>
<TD ALIGN="LEFT" VALIGN="TOP" WIDTH="25%"><TT><STRONG>output</STRONG></TT>
</TD><TD ALIGN="LEFT" VALIGN="TOP" WIDTH="25%">field
</TD><TD ALIGN="LEFT" VALIGN="TOP" WIDTH="50%">shaded object
</TD></TR></TABLE>
<P><STRONG>Functional Details</STRONG>
<P>
This module is applicable only to surface objects (i.e., objects with
connections of type "triangle" or "quad").
<TABLE CELLPADDING="3">
<TR VALIGN="TOP"><TD><P><B><TT><STRONG>input</STRONG></TT>
</B></TD><TD><P>specifies the object whose shading attributes are to be
modified.
</TD></TR><TR VALIGN="TOP"><TD><P><B><TT><STRONG>shade</STRONG></TT>
</B></TD><TD><P>turns shading on or off.
By default, the module turns shading on.
</TD></TR><TR VALIGN="TOP"><TD><P><B><TT><STRONG>how</STRONG></TT>
</B></TD><TD><P>specifies whether the shading is to be smooth or faceted.
If this parameter is not set, and:
<UL COMPACT>
<LI>if the input object is already shaded, the shading method is not
changed.
<LI>if the object is not shaded, the choice between smooth and faceted
shading is determined by the dependency of the "data"
component, if it has a data dependency:
<DL>
<DD><P>smooth shading is used for position-dependent data.
<DD><P>faceted shading is used for connection-dependent data.
</DL>
<LI>if no data are present, smooth shading is used.
</UL>
<P>
An explicit specification of "smooth" or "faceted" shading
will apply to all objects.
However, if a "normals" component of the requested type ("dep"
"positions" or "dep" "connections") is already present,
the normals are not recomputed.
</TD></TR></TABLE>
<P>
The next four parameters specify the particular shading attributes of
the object.
If any of these parameters are not explicitly set, the corresponding
attributes remain unchanged.
<TABLE CELLPADDING="3">
<TR VALIGN="TOP"><TD><P><B><TT><STRONG>specular</STRONG></TT>
</B></TD><TD><P>specifies the amount of light reflected by the object (as from a
very smooth, highly reflective surface).
The specified value must be between 0 and 1.
The default is 0.5.
</TD></TR><TR VALIGN="TOP"><TD><P><B><TT><STRONG>shininess</STRONG></TT>
</B></TD><TD><P>specifies how sharp the specular highlight is.
The specified value must be an integer.
Larger numbers result in a smaller, sharper, specular highlight.
The default is 10.
</TD></TR><TR VALIGN="TOP"><TD><P><B><TT><STRONG>diffuse</STRONG></TT>
</B></TD><TD><P>specifies how much light is diffused by the object (as from a
rough non-reflective surface).
The specified value must be between 0 and 1.
The default is 1 (one).
</TD></TR><TR VALIGN="TOP"><TD><P><B><TT><STRONG>ambient</STRONG></TT>
</B></TD><TD><P>specifies how much light is reflected equally in all directions.
The specified value must be between 0 and 1.
</TD></TR></TABLE>
<P>

<P><B>Notes: </B><OL>
<P><LI>The Shade module will also check whether the orientation of the
"connections" component is consistent with the directions of
the "normals". If they are not consistent, it will modify the
directions of the normals.
<P><LI>Smooth shading is not supported for faces, loops, and edges data.
However, faces, loops, and edges can be converted to triangles using
Refine, and can then be smooth-shaded.
</OL>

<P><STRONG>Components</STRONG>
<P>
May add or modify the "normals" component.
All other components are unchanged.
<P><STRONG>Example Visual Programs</STRONG>
<PRE>
AlternateVisualizations.net
Imide&#95;potential.net
UsingShade.net
</PRE>
<P><STRONG>See Also</STRONG>
<P>

&nbsp;<A HREF="refgu118.htm#HDRRENDER">Render</A>,
&nbsp;<A HREF="refgu048.htm#HDRDISPLAY">Display</A>,
&nbsp;<A HREF="refgu072.htm#HDRIMAGE">Image</A>
		<P>
		<HR>
		<DIV align="center">
			<P><A href="../allguide.htm"><IMG src="../images/foot-fc.gif" width="94" height="18" border="0" alt="Full Contents"></A> <A href="../qikguide.htm"><IMG src="../images/foot-qs.gif" width="94" height="18" border="0" alt="QuickStart Guide"></A> <A href="../usrguide.htm"><IMG src="../images/foot-ug.gif" width="94" height="18" border="0" alt="User's Guide"></A> <A href="../refguide.htm"><IMG src="../images/foot-ur.gif" width="94" height="18" border="0" alt="User's Reference"></A></P>
		</DIV>
		<DIV align="center">
			<P><FONT size="-1">[ <A href="http://www.research.ibm.com/dx">OpenDX Home at IBM</A>&nbsp;|&nbsp;<A href="http://www.opendx.org/">OpenDX.org</A>&nbsp;] </FONT></P>
			<P></P>
		</DIV>
		<P></P>
	</BODY></HTML>
